﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project_Control.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.BGM_Project_Control" %>

<%@ Register src="../Controls/Combo/YearCombo.ascx" tagname="year" tagprefix="uc8" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head id="Head1" runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <link rel="Stylesheet" href="../../Styles/StyleSheet.css" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
</head>
	<body>
	    <form id="form1" method="post" runat="server" class="defaultFont">

            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" > 
            </telerik:RadAjaxLoadingPanel>
        
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="rblType">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="rblType" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="ddlBgmProjSeq" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="Filter">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="Filter" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="DivDisplay" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="DivDisplay">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="DivDisplay" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="DivDisplay" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
		
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <script type="text/javascript">

                    function closeRadWindow(sender, args) {
                        return false;
                    }

                    function openProjectControlAdd(id, ctrl_type, type, send_or_receive, job_site_seq, bgm_proj_exp_ctrl_seq) {

                        radopen("BGM_Project_Control_Add.aspx?id=" + id + "&ctrl_type=" + ctrl_type + "&type=" + type + "&send_or_receive=" + send_or_receive + "&job_site_seq=" + job_site_seq + "&bgm_proj_exp_ctrl_seq=" + bgm_proj_exp_ctrl_seq, "AddProjectControl");

                        return false;
                    }

                    function refreshGrid()
                    {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
                    }

                </script>
            </telerik:RadCodeBlock>
    
            <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true"
                runat="server" Modal="true" KeepInScreenBounds="false" Style="z-index: 8000">
                <Windows>
                    <telerik:RadWindow ID="AddProjectControl" runat="server" Width="800px" Behaviors="Reload, Close" Height="500px">
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>

            <div class="DivControl" align="left">
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="lbJobSiteName" runat="server" Text="-" ForeColor="White" Font-Bold="true" Font-Size="Large"></asp:Label>
                <input id="hdHeaderID" runat="server" type="hidden" />
                <input id="hdBgmYear" runat="server" type="hidden" />
            </div>
            <div class="DivBody" style="border-bottom-style: solid; border-width: 1px; margin-right: 20px; margin-left: 20px;">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <asp:RadioButtonList ID="rblType" runat="server" AutoPostBack="true" 
                                RepeatDirection="Horizontal" Width="650px"
                                OnSelectedIndexChanged="rblType_SelectedIndexChanged">
                                <asp:ListItem Text="โครงการ <-> กิจกรรมย่อย" Value="1" Selected="True" />
                                <asp:ListItem Text="กิจกรรมย่อย <-> สำนัก" Value="2" />
                                <asp:ListItem Text="สำนัก <-> กรม" Value="3" />
                                <%--<asp:ListItem Text="โอนเปลี่ยนแปลง" Value="4" Enabled="false" />--%>
                            </asp:RadioButtonList>
                            <!--
                                <asp:ListItem Text="โครงการ <-> กิจกรรมย่อย" Value="1" />
                                <asp:ListItem Text="กิจกรรมย่อย <-> สังกัด" Value="2" />
                                <asp:ListItem Text="สังกัด <-> กรม" Value="3" />
                                -->
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td>
                            <telerik:RadComboBox ID="ddlBgmProjSeq" runat="server" Width="500px" 
                                Filter="Contains" DataTextField="bgm_proj_name" 
                                DataValueField="bgm_proj_seq" EmptyMessage=" พิมพ์ที่นี่เพื่อค้นหาโครงการ">
                            </telerik:RadComboBox>
                        </td>
                        <td width="20px">
                        </td>
                        <td>
                            <asp:LinkButton ID="Filter" runat="server" CssClass="LinkButton" onclick="Filter_Click"
                                OnClientClick="javascript: return confirm('โปรดระวัง!! เนื่องจากมีข้อมูลของโครงการเป็นจำนวนมาก หากแสดงผลทุกโครงการพร้อมกันจะมีผลกับความเร็วในการแสดงผล ต้องการดำเนินการต่อหรือไม่?');">แสดงข้อมูล
                            </asp:LinkButton>
                            <%--<asp:Button ID="Filter" runat="server" Text="แสดงข้อมูล" onclick="Filter_Click"
                                OnClientClick="javascript: return confirm('โปรดระวัง!! เนื่องจากมีข้อมูลของโครงการเป็นจำนวนมาก หากแสดงผลทุกโครงการพร้อมกันจะมีผลกับความเร็วในการแสดงผล ต้องการดำเนินการต่อหรือไม่?');" />--%>
                        </td>
                    </tr>
                </table>                
            </div>
            <div id="DivDisplay" runat="server" align="center">
                <ul style="padding: 0px; margin: 0px; list-style: none;">
                    <li id="liProject" runat="server" style="float: left; width: 460px; margin-left: 20px;">
                        <div style="padding-top: 10px; padding-bottom: 10px; font-size: large; color: #0066FF; font-weight: bold" align="center">
                            โครงการ
                        </div>
                        <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGridProjectControl" runat="server" 
                            AutoGenerateColumns="False" AllowFilteringByColumn="false"
                            Width="100%" OnItemCommand="RadGridProjectControl_ItemCommand">
                             
                            <MasterTableView NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" GroupLoadMode="Client" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="bgm_strat_list_seq" UniqueName="bgm_strat_list_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_seq" UniqueName="bgm_source_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_seq" UniqueName="bgm_exp_grp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_seq" UniqueName="bgm_proj_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_seq" UniqueName="bgm_exp_seq" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_strat_list_name" UniqueName="bgm_strat_list_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_name" UniqueName="bgm_source_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_name" UniqueName="bgm_exp_grp_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_name" UniqueName="bgm_proj_name" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                                        FilterControlWidth="100%" HeaderText="ค่าใช้จ่าย"
                                        UniqueName="bgm_exp_name" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount"
                                        DataFormatString="{0:n2}"
                                        HeaderText="บาท"
                                        UniqueName="amount"
                                        AllowFiltering="false">
                                        <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    
                                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true" UniqueName="button">
                                        <HeaderStyle Width="55px" HorizontalAlign="Center"></HeaderStyle>
                                        <ItemTemplate>
                                            <%--<asp:ImageButton ID="cmdPlus" runat="server" ImageUrl="../Image/Grid/back.gif" ToolTip="ดึงเงินจากกองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "0", rblType.SelectedValue, "R", hdHeaderID.Value, "") %>' />--%>
                                            <asp:ImageButton ID="cmdMinus" runat="server" ImageUrl="../Image/Grid/forward red.gif" ToolTip="คืนเงินเข้ากองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "0", rblType.SelectedValue, "S", hdHeaderID.Value, "") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_name" HeaderText="กิจกรรมย่อย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_name" HeaderText="โครงการ :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    
                                </GroupByExpressions>
                            </MasterTableView>
                            <clientsettings>
                                <ClientEvents /><Selecting AllowRowSelect="True" />
                                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
                            </clientsettings>
                        </telerik:RadGrid>
                    </li>
                    <li id="liSubAct" runat="server" style="float: left; width: 460px; margin-left: 20px;">
                        <div style="padding-top: 10px; padding-bottom: 10px; font-size: large; color: #0066FF; font-weight: bold">
                            กิจกรรมย่อย
                        </div>
                        <telerik:RadGrid GroupingSettings-CaseSensitive="false" 
                            ID="RadGridSubActControl" runat="server" 
                            AutoGenerateColumns="False" AllowFilteringByColumn="false"
                            Width="100%" OnItemCommand="RadGridSubActControl_ItemCommand"
                             
                            onitemdatabound="RadGridSubActControl_ItemDataBound">
                            <MasterTableView NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" GroupLoadMode="Client" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="bgm_strat_list_seq" UniqueName="bgm_strat_list_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_seq" UniqueName="bgm_source_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_seq" UniqueName="bgm_exp_grp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_seq" UniqueName="bgm_proj_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_seq" UniqueName="bgm_exp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_exp_ctrl_seq" UniqueName="bgm_proj_exp_ctrl_seq" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_strat_list_name" UniqueName="bgm_strat_list_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_name" UniqueName="bgm_source_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_name" UniqueName="bgm_exp_grp_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_name" UniqueName="bgm_proj_name" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                                        FilterControlWidth="100%" HeaderText="ค่าใช้จ่าย"
                                        UniqueName="bgm_exp_name" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount"
                                        DataFormatString="{0:n2}"
                                        HeaderText="บาท"
                                        UniqueName="amount"
                                        AllowFiltering="false">
                                        <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    
                                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true" UniqueName="button">
                                        <HeaderStyle Width="55px" HorizontalAlign="Center"></HeaderStyle>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="cmdPlus" runat="server" ImageUrl="../Image/Grid/back.gif" ToolTip="ดึงเงินจากกองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "1", rblType.SelectedValue, "R", hdHeaderID.Value, Eval("bgm_proj_exp_ctrl_seq")) %>' />
                                            <asp:ImageButton ID="cmdMinus" runat="server" ImageUrl="../Image/Grid/forward red.gif" ToolTip="คืนเงินเข้ากองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "1", rblType.SelectedValue, "S", hdHeaderID.Value, Eval("bgm_proj_exp_ctrl_seq")) %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_name" HeaderText="กิจกรรมย่อย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_name" HeaderText="โครงการ :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                            <clientsettings>
                                <ClientEvents /><Selecting AllowRowSelect="True" />
                                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
                            </clientsettings>
                        </telerik:RadGrid>
                    </li>
                    <li id="liJobsite" runat="server" style="float: left; width: 460px; margin-left: 20px;">
                        <div style="padding-top: 10px; padding-bottom: 10px; font-size: large; color: #0066FF; font-weight: bold">
                            สำนัก
                        </div>
                        <telerik:RadGrid GroupingSettings-CaseSensitive="false" 
                            ID="RadGridJobsiteControl" runat="server" 
                            AutoGenerateColumns="False" AllowFilteringByColumn="false"
                            Width="100%" OnItemCommand="RadGridJobsiteControl_ItemCommand"
                             
                            onitemdatabound="RadGridJobsiteControl_ItemDataBound">
                            <MasterTableView NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" GroupLoadMode="Client" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="bgm_strat_list_seq" UniqueName="bgm_strat_list_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_seq" UniqueName="bgm_source_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_seq" UniqueName="bgm_exp_grp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_seq" UniqueName="bgm_proj_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_seq" UniqueName="bgm_exp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_exp_ctrl_seq" UniqueName="bgm_proj_exp_ctrl_seq" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_strat_list_name" UniqueName="bgm_strat_list_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_name" UniqueName="bgm_source_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_name" UniqueName="bgm_exp_grp_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_name" UniqueName="bgm_proj_name" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                                        FilterControlWidth="100%" HeaderText="ค่าใช้จ่าย"
                                        UniqueName="bgm_exp_name" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount"
                                        DataFormatString="{0:n2}"
                                        HeaderText="บาท"
                                        UniqueName="amount"
                                        AllowFiltering="false">
                                        <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    
                                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true" UniqueName="button">
                                        <HeaderStyle Width="55px" HorizontalAlign="Center"></HeaderStyle>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="cmdPlus" runat="server" ImageUrl="../Image/Grid/back.gif" ToolTip="ดึงเงินจากกองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "2", rblType.SelectedValue, "R", hdHeaderID.Value, Eval("bgm_proj_exp_ctrl_seq")) %>' />
                                            <asp:ImageButton ID="cmdMinus" runat="server" ImageUrl="../Image/Grid/forward red.gif" ToolTip="คืนเงินเข้ากองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "2", rblType.SelectedValue, "S", hdHeaderID.Value, Eval("bgm_proj_exp_ctrl_seq")) %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_name" HeaderText="กิจกรรมย่อย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_name" HeaderText="โครงการ :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                            <clientsettings>
                                <ClientEvents /><Selecting AllowRowSelect="True" />
                                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
                            </clientsettings>
                        </telerik:RadGrid>
                    </li>
                    <li id="liDepartment" runat="server" style="float: left; width: 460px; margin-left: 20px;">
                        <div style="padding-top: 10px; padding-bottom: 10px; font-size: large; color: #0066FF; font-weight: bold">
                            กรม
                        </div>
                        <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGridDepartmentControl" runat="server" 
                            AutoGenerateColumns="False" AllowFilteringByColumn="false"
                            Width="100%" OnItemCommand="RadGridDepartmentControl_ItemCommand"
                             >
                            <MasterTableView NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" GroupLoadMode="Client" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="bgm_strat_list_seq" UniqueName="bgm_strat_list_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_seq" UniqueName="bgm_source_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_seq" UniqueName="bgm_exp_grp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_seq" UniqueName="bgm_proj_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_seq" UniqueName="bgm_exp_seq" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_exp_ctrl_seq" UniqueName="bgm_proj_exp_ctrl_seq" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_strat_list_name" UniqueName="bgm_strat_list_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_name" UniqueName="bgm_source_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_exp_grp_name" UniqueName="bgm_exp_grp_name" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_proj_name" UniqueName="bgm_proj_name" Visible="false">
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                                        FilterControlWidth="100%" HeaderText="ค่าใช้จ่าย"
                                        UniqueName="bgm_exp_name" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount"
                                        DataFormatString="{0:n2}"
                                        HeaderText="บาท"
                                        UniqueName="amount"
                                        AllowFiltering="false">
                                        <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    
                                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true" UniqueName="button">
                                        <HeaderStyle Width="55px" HorizontalAlign="Center"></HeaderStyle>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="cmdPlus" runat="server" ImageUrl="../Image/Grid/back.gif" ToolTip="ดึงเงินจากกองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "3", rblType.SelectedValue, "R", hdHeaderID.Value, Eval("bgm_proj_exp_ctrl_seq")) %>' />
                                            <%--<asp:ImageButton ID="cmdMinus" runat="server" ImageUrl="../Image/Grid/forward red.gif" ToolTip="คืนเงินเข้ากองกลาง" OnClientClick='<%# string.Format("return openProjectControlAdd(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", Eval("bgm_proj_exp_seq"), "3", rblType.SelectedValue, "S", hdHeaderID.Value, Eval("bgm_proj_exp_ctrl_seq")) %>' />--%>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_strat_list_name" HeaderText="กิจกรรมย่อย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_seq" HeaderText="&nbsp;" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="bgm_proj_name" HeaderText="โครงการ :" HeaderValueSeparator="" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                            <clientsettings>
                                <ClientEvents /><Selecting AllowRowSelect="True" />
                                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
                            </clientsettings>
                        </telerik:RadGrid>
                    </li>
                </ul>
            </div>
		</form>
	</body>
</html>
